<layout name="master"/>
<ul class="breadcrumb no-border no-radius b-b b-light pull-in">
    <li><a href="index.html"><i class="fa fa-home"></i> Home</a></li>
    <li><a href="#">类型</a></li>
    <li><a href="#">类型管理</a></li>
</ul>
<div class="m-b-md">
    <h3 class="m-b-none">类型管理</h3>
</div>
<div class="row">
    <div class="col-sm-12">
        <section class="panel panel-default">
            <header class="panel-heading font-bold">类型列表</header>
            <div class="panel-body">
                <form role="form" action="" method="post">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th>编号</th>
                            <th>类型名称</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="typeData" id="v">
                            <tr>
                                <td>{$v['tid']}</td>
                                <td>{$v['tname']}</td>
                                <td>
                                    <div class="btn-group">
                                        <a href="{:u('TypeAttr/lists',['tid'=>$v['tid']])}" class="btn btn-success btn-xs">属性列表</a>
                                        <a href="{:u('admin/type/add',['tid'=>$v['tid']])}" class="btn btn-info btn-xs">编辑</a>
                                        <!--<a href="{:u('admin/Type/delType',['tid'=>$v['tid']])}" class="btn btn-danger btn-xs">删除</a>-->
                                        <a onclick="delType({$v['tid']})" href="javascript:;" class="btn btn-danger btn-xs">删除</a>

                                    </div>
                                </td>
                            </tr>
                        </volist>
                        </tbody>

                    </table>
                </form>
            </div>
        </section>
    </div>
</div>
<script>
    function delType(tid) {
        require(['util'], function (util) {
            var obj = util.modal({
                title:'确认删除吗?',//标题
                content:'',//内容
                footer:'<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button><button type="button" class="btn btn-danger confirm" data-dismiss="modal">确认</button>',//底部
                width:600,//宽度
                events:{
                    confirm:function(){
                        //哪个元素上有.confirm类，被点击就执行这个回调
                        location.href = '__CONTROLLER__/delType/' + 'tid/' + tid;
                    }
                }
            });
            //显示模态框
            obj.modal('show');
        });
    }
</script>
